package com.gnerv.pabu.test.role.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.Duration;
import java.time.Instant;
import java.time.LocalDateTime;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/role")
public class RoleController {

    @RequestMapping(value = "/post", method = RequestMethod.POST)
    public String getRole(@RequestBody Map<String, String> map, @RequestParam(value = "startTime") Long startTime) {
        long l = Instant.now().toEpochMilli();
        log.info("相差{}", String.valueOf(l - startTime));
        return String.valueOf(startTime + "-" + l + "_" + map.toString());
    }

}
